home *** CD-ROM | disk | FTP | other *** search
- /*--------------------------------------------------------------------------*/
- /* */
- /* */
- /* ------------ Bit-Bucket Software <no-Inc> */
- /* \ 10001101 / Writers and Distributors of */
- /* \ 011110 / No-Cost<no-tm> Software. */
- /* \ 1011 / */
- /* ------ */
- /* */
- /* Copyright (C) 1987, 1988, 1989 by Robert Hartman and Vincent Perriello */
- /* */
- /* */
- /* BinkleyTerm "WaZOO" Processor */
- /* */
- /* */
- /* For complete details of the licensing restrictions, please refer */
- /* to the License agreement, which is published in its entirety in */
- /* the MAKEFILE and BT.C, and also contained in the file LICENSE.210. */
- /* */
- /* USE OF THIS FILE IS SUBJECT TO THE RESTRICTIONS CONTAINED IN THE */
- /* BINKLEYTERM LICENSING AGREEMENT. IF YOU DO NOT FIND THE TEXT OF */
- /* THIS AGREEMENT IN ANY OF THE AFOREMENTIONED FILES, OR IF YOU DO */
- /* NOT HAVE THESE FILES, YOU SHOULD IMMEDIATELY CONTACT THE AUTHORS */
- /* AT THE ADDRESSES LISTED BELOW. IN NO EVENT SHOULD YOU PROCEED TO */
- /* USE THIS FILE WITHOUT HAVING ACCEPTED THE TERMS OF THE */
- /* BINKLEYTERM LICENSING AGREEMENT, OR SUCH OTHER AGREEMENT AS YOU */
- /* ARE ABLE TO REACH WITH THE AUTHORS. */
- /* */
- /* */
- /* The Authors can be reached at the following addresses: */
- /* */
- /* Robert C. Hartman Vincent E. Perriello */
- /* Spark Software VEP Software */
- /* 427-3 Amherst Street 111 Carroll Street */
- /* CS2032, Suite 232 Naugatuck, CT 06770 */
- /* Nashua, NH 03061 */
- /* */
- /* FidoNet 1:132/101 FidoNet 1:141/491 */
- /* Data (603) 888-8179 Data (203) 729-7569 */
- /* */
- /* Please feel free to contact us at any time to share your comments */
- /* about our software and/or licensing policies. */
- /* */
- /* */
- /* This module is based largely on a similar module in OPUS-CBCS V1.03b. */
- /* The original work is (C) Copyright 1987, Wynn Wagner III. The original */
- /* author has graciously allowed us to use his code in this work. */
- /* */
- /*--------------------------------------------------------------------------*/
-
- #include <signal.h>
- #include <ctype.h>
- #include <conio.h>
-
- #define WAZOO_SECTION
- #define MATRIX_SECTION
-
- #include "com.h"
- #include "xfer.h"
- #include "zmodem.h"
- #include "keybd.h"
- #include "sbuf.h"
- #include "sched.h"
- #include "externs.h"
- #include "prototyp.h"
-
- static int get_ZedZap (char *, FILE *);
- static int send_ZedZap (char *, char *, int, int);
- static int (*wzgetfunc) (char *, FILE *);
-
- int (*wzsendfunc) (char *, char *, int, int);
- extern int WaZOO_callback (char *);
-
-
- static int get_ZedZap (rcvpath, xferinfo)
- char *rcvpath;
- FILE *xferinfo;
- {
- return (get_Zmodem (rcvpath, xferinfo));
- }
-
- static int send_ZedZap (fname, alias, fsent, wazoo)
- char *fname;
- char *alias;
- int fsent;
- int wazoo;
- {
- return (Send_Zmodem (fname, alias, fsent, wazoo));
- }
-
- /*--------------------------------------------------------------------------*/
- /* WaZOO */
- /*--------------------------------------------------------------------------*/
- void WaZOO (originator)
- int originator;
- {
- int stat;
- int i = 0;
-
- /*--------------------------------------------------------------------*/
- /* Initialize WaZOO */
- /*--------------------------------------------------------------------*/
- stat =
- made_request =
- got_arcmail =
- got_packet = 0;
-
- Netmail_Session = 1;
-
- isOriginator = originator;
-
- if (originator && ((remote_zone != called_zone) || (remote_net != called_net) || (remote_node != called_node)))
- {
- status_line ("!Called %d:%d/%d and got %d:%d/%d",
- called_zone, called_net, called_node,
- remote_zone, remote_net, remote_node);
- }
- else
- {
- called_zone = remote_zone;
- called_net = remote_net;
- called_node = remote_node;
- }
-
- if (!CARRIER)
- return;
-
-
- #ifdef JANUS
- /* Try Janus first */
- if ((remote_capabilities & DOES_IANUS) && (janus_baud >= cur_baud))
- {
- Janus ();
- mdm_hangup ();
- return;
- }
- #endif
-
-
- /* See if we can both do ZEDZAP */
- if (remote_capabilities & ZED_ZAPPER)
- {
- status_line (":WaZOO method: ZedZap");
- wzgetfunc = get_ZedZap;
- wzsendfunc = send_ZedZap;
- }
- else
- {
- status_line (":WaZOO method: DietIfna");
- if (originator)
- {
- FTSC_sender (1);
- }
- else
- {
- FTSC_receiver (1);
- }
- return;
- }
-
-
- /*--------------------------------------------------------------------*/
- /* ORIGINATOR: send/receive/send */
- /*--------------------------------------------------------------------*/
- if (originator)
- {
-
- send_WaZOO ();
- if (!CARRIER)
- goto endwazoo;
- if (!(*wzgetfunc) (CurrentNetFiles, NULL))
- goto endwazoo;
-
- if (!CARRIER)
- goto endwazoo;
- stat = respond_to_file_requests (i, WaZOO_callback);
- if (stat)
- (*wzsendfunc) (NULL, NULL, ((stat) ? END_BATCH : NOTHING_TO_DO), DO_WAZOO);
- mail_finished = 1;
- }
-
- /*--------------------------------------------------------------------*/
- /* CALLED SYSTEM: receive/send/receive */
- /*--------------------------------------------------------------------*/
- else
- {
- if (!(*wzgetfunc) (CurrentNetFiles, NULL))
- goto endwazoo;
- if (!CARRIER)
- goto endwazoo;
- send_WaZOO ();
- if (!CARRIER || !made_request)
- goto endwazoo;
- (*wzgetfunc) (CurrentNetFiles, NULL);
-
- }
-
- endwazoo:
- status_line ("*End of WaZOO Session");
-
- } /* wazoo */
-